package com.jt.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController//标识Controller层，并且返回json串
@Configuration//指定配置类
public class PortController {

    @Value("${server.port}")
    private Integer port;//注入端口

    @GetMapping("/getPort")
    public String getPort(){
        return "端口号" + port;
    }
}
